<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" th:with="title='sys_dict'">
<meta charset="utf-8">
<header th:replace="header::headerFragment(${title})"></header>
<body class="gray-bg">
	<div class="wrapper wrapper-content ">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal m-t" id="DictForm">
							<input id="dictType" name="dictType" th:value="${dict.dictType}" type="hidden">
							<div class="form-group">
								<label class="col-sm-3 control-label">字典描述：</label>
								<div class="col-sm-8">
									<input id="dictDescribe" name="dictDescribe" th:value="${dict.dictDescribe}" class="form-control" type="text">
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-3 control-label">状态：</label>
								<div class="col-sm-8">
										<label class="radio-inline" th:each="dict:${@dict.getDictData('Status')}"> <input th:field="*{dict.status}" type="radio" th:value="${dict.dictNo}"
										th:text="${dict.dictName}" />
									</label>
								</div>
							</div>
							<div class="form-group">
								<div class="col-sm-8 col-sm-offset-3">
									<button type="submit" class="btn btn-primary">提交</button>
								</div>
							</div>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:replace="footer :: footer"></div>
	<script type="text/javascript">
	var prefix = ctx + "sys/dict";
		$().ready(function() { 
			validateRule(); 
		}); 
		
		$.validator.setDefaults({ 
			submitHandler : function() { 
				update(); 
			} 
		}); 
		
		function update() {
			yimo.ajaxPut({ 
				url : prefix + "/update", 
				data : $('#DictForm').serialize(), 
				needClose : true, 
				parentRefresh : true, 
			}); 
		} 
		
		function validateRule() { 
			var icon = "<i class='fa fa-times-circle'></i>"; 
			$("#DictForm").validate({ 
				rules : { 
					dictDescribe : { 
						required : true }, 
						status : {
							required : true 
						}, 
					}, 
					messages : { 
						dictDescribe : { 
							required : icon + "请输入字典描述" 
						},
						status : { 
							required : icon + "请输入状态" 
						}, 
					} 
				}) 
			}
		
	</script>
</body>
</html>
